need_resched_back:
perfc_incrc(sched_run2);
- now = NOW();
- next = NULL;
+
prev = current;
+ next = NULL;
+
this_cpu = prev->processor;
+ spin_lock_irq(&schedule_data[this_cpu].lock);
+
+ now = NOW();
+
/* remove timer */
rem_ac_timer(&schedule_data[this_cpu].s_timer);
* deschedule the current domain
*/
- spin_lock_irq(&schedule_data[this_cpu].lock);
-
ASSERT(!in_interrupt());
ASSERT(__task_on_runqueue(prev));
+
if (is_idle_task(prev))
goto deschedule_done;
* work out how long 'next' can run till its evt is greater than
* 'next_prime's evt. Taking context switch allowance into account.
*/
- ASSERT(next_prime->evt > next->evt);
+ ASSERT(next_prime->evt >= next->evt);
r_time = ((next_prime->evt - next->evt)/next->mcu_advance) + ctx_allow;
sched_done:
ASSERT(r_time != 0);
- ASSERT(r_time > ctx_allow);
+ ASSERT(r_time >= ctx_allow);
-#if 0
+#ifndef NDEBUG
if ( (r_time==0) || (r_time < ctx_allow)) {
printk("[%02d]: %lx\n", this_cpu, r_time);
dump_rqueue(&schedule_data[this_cpu].runqueue, "foo");
timer_redo:
schedule_data[this_cpu].s_timer.expires = now + r_time;
if (add_ac_timer(&schedule_data[this_cpu].s_timer) == 1) {
- printk("SCHED[%02d]: Shit this shouldn't happen\n", this_cpu);
+ printk("SCHED[%02d]: Shit this shouldn't happen r_time=%lu\n",
+ this_cpu, r_time);
now = NOW();
goto timer_redo;
}